﻿using System;
using SimpleInjector;

namespace YuYuKiCms.Framework.DI
{
    public static class ServiceLocator
    {
        public static Container Current { get; set; }

        public static T GetInstance<T>() where T : class
        {
            return Current == null ? default(T) : Current.GetInstance<T>();
        }

        public static Object GetInstance(Type type)
        {
            return Current == null ? null : Current.GetInstance(type);
        }
    }
}